<?php
ob_start();
include_once("includes/user.php");
if (isset($_POST['bt_signup'])) {
    $username = $_POST['txt_username'];
    $password = $_POST['txt_password'];
    $fullname = $_POST['txt_fullname'];
    $birthday = $_POST['txt_yearofbirth']."-".$_POST['txt_monthofbirth']."-".$_POST['txt_dayofbirth'];
    $job = $_POST['txt_job'];
    $marriage = $_POST['status'] == "marrige" ? 1 : 0;
    $address = $_POST['txt_address'];
    $id_province = $_POST['list_provinces'];
    $phone = $_POST['txt_phone'];
    $email = $_POST['txt_email'];
    
    $check = insertUser($username, $password, $fullname, $birthday, $job, $marriage, $address, $id_province, $phone, $email, "");
    if ($check) header('location:index.php?p=index');
    else header('location:index.php?p=signup');
}
?>